<?php
/**
 * 
 * @author Hieunm
 *
 */
class User extends Model_AbstractModel{
	private $userName;
	private $userPass;
	private $userType;
	private $userNameDisplay;
	private $loginDate;
	private $logoutDate;
	
	public function __construct($data) {
		parent::__construct($data);
		if (is_array ( $data )) {
			
			if (isset ( $data ['user_name'] )) {
				$this->userName = $data ['user_name'];
			}
			
			if (isset ( $data ['user_pass'] )) {
				$this->userPass = $data ['user_pass'];
			}
			
			if (isset ( $data ['user_type'] )) {
				$this->userType = $data ['user_type'];
			}
			
			if (isset ( $data ['user_name_display'] )) {
				$this->userNameDisplay = $data ['user_name_display'];
			}
			
			if (isset ( $data ['login_date'] )) {
				$this->loginDate = $data ['login_date'];
			}
			
			if (isset ( $data ['logout_date'] )) {
				$this->logoutDate = $data ['logout_date'];
			}
			
		}
	}
	
	/**
	 * (non-PHPdoc)
	 * @see Model_AbstractModel::toArray()
	 */
	public function toArray() {
		$arr = parent::toArray();
		$arr['user_name']		  = $this->userName;
		$arr['user_pass']	      = $this->userPass;
		$arr['user_type']         = $this->userType;
		$arr['user_name_display'] = $this->userNameDisplay;
		$arr['login_date']	      = $this->loginDate;
		$arr['logout_date']	      = $this->logoutDate;
	
		return $arr;
	}

	
	public function getUserName() {
		return $this->userName;
	}
	
	public function getUserPass() {
		return $this->userPass;
	}
	
	public function getUserType() {
		return $this->userType;
	}
	
	public function getUserNameDisplay() {
		return $this->userNameDisplay;
	}
	
	public function getLoginDate() {
		return $this->loginDate;
	}
	
	public function getLogoutDate() {
		return $this->logoutDate;
	}
	
	public function setUserName($x) {
		$this->userName = $x;
	}	
	
	public function setUserPass($x) {
		$this->userPass = $x;
	}
	
	public function setUserType($x) {
		$this->userType = $x;
	}
	
	public function setUserNameDisplay($x) {
		$this->userNameDisplay = $x;
	}
	
	public function setLoginDate($x) {
		$this->loginDate = $x;
	}
	
	public function setLogoutDate($x) {
		$this->logoutDate = $x;
	}
	
}